//
//  HWYouXiCell.m
//  HWanGame
//
//  Created by Chendaobin on 2019/8/28.
//  Copyright © 2019年 Chendaobin. All rights reserved.
//

#import "HWYouXiCell.h"
#import "HWRenqiOrZuixinOrYuGaoView.h"

@interface HWYouXiCell()
@property(strong,nonatomic) HWRenqiOrZuixinOrYuGaoView *renqiOrZuixinview;

@end

@implementation HWYouXiCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpUI];
        
    }
    
    return  self;
    
}


-(void)setUpUI  {
    
    self.renqiOrZuixinview = [[HWRenqiOrZuixinOrYuGaoView alloc]initWithFrame: CGRectMake(0, 0, kScreenW, self.frame.size.height)];
    
    NSLog(@"自定义高度 %lf",self.frame.size.height);
    
    [self.contentView addSubview:self.renqiOrZuixinview];
    
    
    
}





// 刷新cell
- (void)shuxiangCell {
  
    self.renqiOrZuixinview.sentimentMuArr = self.sentimentMuArr;
    self.renqiOrZuixinview.latestMutaBleArr =  self.latestMutaBleArr;
    self.renqiOrZuixinview.trailerMutableArr = self.trailerMutableArr;
    self.renqiOrZuixinview.xuanzhongTag = self.xuanzhongTag;
    self.renqiOrZuixinview.judgeStr = self.judgeStr;
    
    
    NSLog(@"3个tableView的高度 %f ---- %f ----- %f",self.diyigeheight,self.ergeheight,self.sangegeheight);

    if (self.xuanzhongTag == 0 ) {
        
        
        if (self.diyigeheight > 160) {
             self.renqiOrZuixinview.frame = CGRectMake(0, 0, kScreenW, self.diyigeheight);
        } else {
            
            self.renqiOrZuixinview.frame = CGRectMake(0, 0, kScreenW, 180);
        }
        
       
        
        
    } else if (self.xuanzhongTag == 1) {
        
         if (self.ergeheight > 160) {
             self.renqiOrZuixinview.frame = CGRectMake(0, 0, kScreenW, self.ergeheight);
             
         } else {
             
             self.renqiOrZuixinview.frame = CGRectMake(0, 0, kScreenW, 180);
         }
        
    } else {
        
        
        if (self.sangegeheight > 160) {
            self.renqiOrZuixinview.frame = CGRectMake(0, 0, kScreenW, self.sangegeheight);
            
        } else {
            
            self.renqiOrZuixinview.frame = CGRectMake(0, 0, kScreenW, 180);
        }
        
        
    
        
    }

    [self.renqiOrZuixinview QC_refreshData];
    
    
}



- (void)layoutSubviews {
    [super layoutSubviews];
    
    
    
}



//- (void)setDiyigeheight:(CGFloat)diyigeheight {
//
//    _diyigeheight = diyigeheight;
//
//
//
//}
//
//
//- (void)setErgeheight:(CGFloat)ergeheight {
//
//    _ergeheight = ergeheight;
//
//
//}
//
//-(void)setSangegeheight:(CGFloat)sangegeheight {
//
//    _sangegeheight = sangegeheight;
//
//}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
